<?php
declare (strict_types=1);

use think\facade\Route;

//前缀
$namespace = '\app\pc\controller\base';
/**
 * pc
 */
Route::group('user', function () use ($namespace) {

    Route::post('login$', $namespace . '\Login@login')->name('学生登录');
})->middleware(middleware\NoAuthMiddleware::class, 'pc');

/**
 * 后台管理
 */
Route::group('user', function () use ($namespace) {
    //学生信息
    Route::get('info$', $namespace . '\Student@read')->name('学生信息');
    Route::post('edit$', $namespace . '\Student@update')->name('编辑学生信息');

})->middleware(middleware\AuthMiddleware::class, 'pc');


Route::group('', function () use ($namespace) {
    //学生信息
    Route::get('index$', $namespace . '\Index@index')->name('首页大厅信息');

})->middleware(middleware\AuthMiddleware::class, 'pc');

Route::group('practise', function () use ($namespace) {
    Route::get('index$', $namespace . '\Practise@index')->name('练习大厅信息');
    Route::get('details$', $namespace . '\Practise@read')->name('练习详情');

})->middleware(middleware\AuthMiddleware::class, 'pc');

Route::group('paper', function () use ($namespace) {
    Route::get('index$', $namespace . '\Paper@index')->name('考试列表');
    Route::get('details$', $namespace . '\Paper@read')->name('考试详情');

})->middleware(middleware\AuthMiddleware::class, 'pc');

Route::group('paper', function () use ($namespace) {
    Route::get('details$', $namespace . '\Paper@read')->name('试卷详情');

})->middleware(middleware\AuthMiddleware::class, 'pc');

Route::group('user', function () use ($namespace) {
    Route::get('paperIndex$', $namespace . '\Paper@lists')->name('我的考试');
    Route::post('paperStart$', $namespace . '\StudentPaper@create')->name('创建考试');
    Route::post('paperUpdate$', $namespace . '\StudentPaper@update')->name('修改考试');
    Route::get('paperDetails$', $namespace . '\StudentPaper@details')->name('考试详情');

    Route::post('practiseStart$', $namespace . '\StudentPractise@create')->name('创建练习');
    Route::post('practiseUpdate$', $namespace . '\StudentPractise@update')->name('修改练习');
    Route::get('practiseIndex$', $namespace . '\Practise@lists')->name('我的练习');
    Route::get('practiseDetails$', $namespace . '\StudentPractise@details')->name('我的练习详情');
    Route::post('practiseDelete$', $namespace . '\Practise@delete')->name('删除练习');

})->middleware(middleware\AuthMiddleware::class, 'pc');


Route::group('ranking', function () use ($namespace) {
    Route::get('index$', $namespace . '\StudentRanking@index')->name('排行版');
})->middleware(middleware\AuthMiddleware::class, 'pc');

Route::group('special', function () use ($namespace) {
    Route::get('index$', $namespace . '\Special@index')->name('专业列表');
})->middleware(middleware\AuthMiddleware::class, 'pc');





